<?php
if(!defined('W_ROOT'))
  {
	$sp=split("/",$_SERVER['PHP_SELF']);
	
	if($_SERVER['HTTP_HOST'] == "localhost")
	    $sp[1] = '/' . $sp[1];
  	else
	    $sp[1] = '';

	require_once $_SERVER['DOCUMENT_ROOT'] . $sp[1] ."/libraryfiles/config.php";
  }
?>
<!DOCTYPE html>

<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]>    <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]>    <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $site_title?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="<?php echo $site_description;?>" />
<meta name="keywords" content="<?php echo $site_keywords;?>" />
<link rel="stylesheet" href="<?php echo W_ROOT;?>/css/style.css" />
  	<link rel="stylesheet" href="<?php echo W_ROOT;?>/templates/stylesheets/brootrap.css" />
  	<link rel="stylesheet" href="<?php echo W_ROOT;?>/templates/stylesheets/foundation.css" />
  	<link rel="stylesheet" href="<?php echo W_ROOT;?>/templates/stylesheets/app.css" />
 <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>   
    <link rel="stylesheet" type="text/css" href="<?php echo W_ROOT;?>/css/menu/ddsmoothmenu.css" />
    <link rel="stylesheet" type="text/css" href="<?php echo W_ROOT;?>/css/menu/ddsmoothmenu-v.css" />


  	<script src="<?php echo W_ROOT;?>/templates/javascripts/modernizr.foundation.js"></script> 
 <script type="text/javascript" src="<?php echo W_ROOT;?>/feature/coin-slider/coin-slider.min.js"></script>
 <link rel="stylesheet" href="<?php echo W_ROOT;?>/feature/coin-slider/coin-slider-styles.css" type="text/css" />


<script src="<?php echo W_ROOT;?>/templates/javascripts/bootstrap-alert.js"></script>



					<link media="screen" rel="stylesheet" href="<?php echo W_ROOT;?>/social/login/widget/css/colorbox.css" />
					<script src="<?php echo W_ROOT;?>/social/login/widget/js/jquery.colorbox.js"></script> 
					<script>
						$(document).ready(function(){
							$(".widget_link").colorbox({iframe:true, innerWidth:430, innerHeight:222});
                            $(".cart_popup").colorbox();
						}); 
					</script>


<?php
if(isset($include)){
	echo $include;
} 
/* Add Javascript and CSS files */
?>
<script language="JavaScript">
function disableEnterKey(e)
{
     var key;     
     if(window.event)
          key = window.event.keyCode; //IE
     else
          key = e.which; //firefox     

     return (key != 13);
}

</script>

<script type="text/javascript">

ddsmoothmenu.init({
	mainmenuid: "smoothmenu1", //menu DIV id
	orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
	classname: 'ddsmoothmenu', //class added to menu's outer DIV
	//customtheme: ["#1c5a80", "#18374a"],
	contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
})

ddsmoothmenu.init({
	mainmenuid: "smoothmenu2", //Menu DIV id
	orientation: 'v', //Horizontal or vertical menu: Set to "h" or "v"
	classname: 'ddsmoothmenu-v', //class added to menu's outer DIV
	//customtheme: ["#804000", "#482400"],
	contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
})

</script>
  <!-- IE Fix for HTML5 Tags -->
  <!--[if lt IE 9]>
    <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
  <![endif]-->
</head>

<body> 

<a name="top"></a>
<?php include(S_ROOT.'/includefiles/header.php');?>
<div class="subhead_shadow"></div>
        <?php
        if($pageURL==$homepage){
        }
        else
        {
            ?>
        <div class="breadcrumb sad_aaa">
            <div class="row breadcrumb_text">
            <?php
                // START BREADCRUMB
                if(!empty($_GET['cat_p']))
                {
                    echo '<i class="icon-home"></i>
					<a href="'.W_ROOT.'">Home</a>';
                    if(!empty($_GET['cat_id']))
                        {
                            
                            $cat_id =$_GET['cat_id']; 
                            //echo $cat_id;
                        }
                        else
                        {
                            $cat_id ='';
                        }
                        if(!empty($_GET['product_id']))
                        {
                            
                            $pro_id =$_GET['product_id']; 
                            //echo $cat_id;
                        }
                        else
                        {
                            $pro_id ='';
                        }
					
                    // FROM PRODUCT 
                    $pro_select     = mysql_query("SELECT product_name FROM tblproduct WHERE id IN('$pro_id')");
                    $pro_name       = mysql_fetch_assoc($pro_select);  
                    // FROM CATGORY                       
                    $cat_p          = $_GET['cat_p'];
                    $sql_name       = "SELECT  id,category_name FROM tblcategory WHERE id IN('$cat_p','$cat_id)";
                    $result_name    = mysql_query($sql_name);
                   while($row_name  = mysql_fetch_array($result_name))
                        {
                    ?>
                    <a href="<?php echo W_ROOT;?>/product/?cat_p=<?php echo $row_name['id'];?>"> <?php echo $row_name['category_name']; ?></a>
                    <?php
                        }
                        if(!empty($pro_name))
                        {
                            echo ' / '.$pro_name['product_name'];
                        }
            
                }
        ?>
        </div>
    </div>
        <?php
        }
            // END BREADCRUMB 
        ?>

<div class="<?php if($pageURL==$homepage){ ?>home_page<?php } else {echo 'not_home';}?>">
<div style="height:20px; clear:both"></div>
        	<?php
			if(!isset($content))
				$content=basename($_SERVER['PHP_SELF']);
				require ($content);
			?>

        </div><!--<div class="six columns">-->
        <div class="two columns pull-seven">
        	<?php 
				if(preg_match("/seller/", $_SERVER['PHP_SELF'])){
				include(S_ROOT.'/seller/left.php');
				}else if(preg_match("/buyer/", $_SERVER['PHP_SELF'])){
				include(S_ROOT.'/buyer/left.php');
				}else{
				include(S_ROOT.'/includefiles/left.php');
				}
			?>
             <?php  include(S_ROOT.'/includefiles/r_contact.php');?> 	
             
          
            <?php
			include(S_ROOT.'/includefiles/banner_ads_left.php');
			
			?>
        </div><!--<div class="three columns">-->        
        <aside class="three columns">
             <div class="sidebar">
        	<?php include(S_ROOT.'/includefiles/right.php');?>     
            </div>
            
            
     </aside><!--<div class="three columns">-->
    </div><!--<div class="row">-->
<div class="feature_b">
    <div class="row">
    <ul>
        <?php
        if(isset($_SESSION['username']))
        {
            include(S_ROOT.'/top_view_user.php');
        }
        else
        {
           include(S_ROOT.'/top_view.php'); 
        }
         ?>
    </ul>
    </div>
</div>
</div><!--End Home page -->   
</div> 
</div>
<div class="clear"></div>
<?php include(S_ROOT.'/includefiles/bottom.php');?>
  <!-- Included JS Files (Compressed) -->
  
  
  <!-- Initialize JS Plugins -->
    <script src="<?php echo W_ROOT;?>/templates/javascripts/bootstrap-dropdown.js"></script>  
    <script type='text/javascript' src="<?php echo W_ROOT;?>/css/menu/menu.js"></script>
    <script src="<?php echo W_ROOT;?>/templates/javascripts/app.js"></script>        
</body>
</html>
    <?php
	if(isset($_GET['updatesuccess'])==1){
	?>
    <script type="text/javascript">
		alert("Update Success!");
	</script>
    <?php
	}
	?>
<?php exit;?>

